package com.iking.toolkit.formatdeal.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;

import java.sql.Blob;
import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

/**
 * <p>
 * 文件格式转换任务
 * </p>
 *
 * @author lqb
 * @since 2025-08-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "文件格式转换任务")
public class FileFormatConversion extends Model<FileFormatConversion> {

    private static final long serialVersionUID = 1L;

    @Schema(description = "文件格式转换任务id")
    @TableId(value = "file_format_conversion_id", type = IdType.INPUT)
    private String fileFormatConversionId;

    @Schema(description = "业务id")
    private String businessId;

    @Schema(description = "转换前文件名称")
    private String beforeFileName;

    @Schema(description = "转换前文件格式")
    private String beforeFileFormat;

    @Schema(description = "转换前文件大小")
    private String beforeFileSize;

    @Schema(description = "转换前文件地址")
    private String beforeFileUrl;

    @Schema(description = "转换分类:TEXT,PDF等")
    private String conversionType;

    @Schema(description = "转换动作")
    private String conversionAction;

    @Schema(description = "转换后文件名称")
    private String afterFileName;

    @Schema(description = "转换后文件格式")
    private String afterFileFormat;

    @Schema(description = "转换后文件大小")
    private String afterFileSize;

    @Schema(description = "转换后文件地址")
    private String afterFileUrl;

    @Schema(description = "转换状态:1.转换中2.转换成功3.转换失败")
    private Integer conversionState;

    @Schema(description = "开始时间")
    private Date startTime;

    @Schema(description = "结束时间")
    private Date endTime;

    @Schema(description = "失败原因")
    private String failCause;


    @Override
    public Serializable pkVal() {
        return this.fileFormatConversionId;
    }

    public <T> T copyProperties(T target) {
        BeanUtils.copyProperties(this, target);
        return target;
    }
}
